<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const fn = () => {
            console.log(123);
        }

        // 求和
        const arr = [2, 3];
        const sum = arr.reduce((a, b) => a + b);
        console.log(sum);
        
        // 升序排列
        const arr1 = [1, 2, 3, -1, -2, 1];
        // console.log(arr1.sort(function(a,b){
        //     return a-b;
        // }));
        console.log(arr1.sort((a, b) => a - b));
        
        // 找出第一个偶数
        const arr2 = [1, 2, 3, -2, 4, 1];
        console.log(arr2.find((item) => item % 2 === 0));
    </script>
</body>
</html>